package com.example.logaop;

import com.example.logaop.entity.GeneralOrder;
import com.example.logaop.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * @author chaird
 * @create 2022-11-20 23:34
 */
@RestController
public class HelloController {


    @Resource
    private OrderService orderService;



    @GetMapping("/hello")
    public Object logAop(){

        GeneralOrder generalOrder = new GeneralOrder();
        generalOrder.setGeneralOrderId(66L);
        System.out.println(orderService.saveOrder(generalOrder));

        System.out.println();

//        VipOrder vipOrder = new VipOrder();
//        vipOrder.setVipOrderId(1119L);
//        System.out.println(orderService.updateOrder(vipOrder));

        //暂停毫秒
        try { TimeUnit.MILLISECONDS.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); }


        return 1;
    }
}
